﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace KSS.Generator.Configuration
{
    public class ProjectSettingPropertyDescriptor : PropertyDescriptor
    {
        ProjectSetting _project;

        public ProjectSettingPropertyDescriptor(ProjectSetting project)
            : base(project.Name, null)
        {
            _project = project;
        }

        public override AttributeCollection Attributes
        {
            get
            {
                return new AttributeCollection(null);
            }
        }

        public override bool CanResetValue(object component)
        {
            return true;
        }

        public override Type ComponentType
        {
            get
            {
                return _project.GetType();
            }
        }
        public override string DisplayName
        {
            get
            {
                return _project.Name;
            }
        }
        public override string Description
        {
            get
            {
                return _project.Description;
            }
        }
        public override object GetValue(object component)
        {
            return _project;
        }

        public override bool IsReadOnly
        {
            get { return true; }
        }
        public override string Name
        {
            get { return _project.Name; }
        }
        public override Type PropertyType
        {
            get
            {
                return _project.GetType();
            }
        }

        public override void ResetValue(object component)
        {

        }

        public override void SetValue(object component, object value)
        {
            
        }

        public override bool ShouldSerializeValue(object component)
        {
            return true;
        }
    }
}
